<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Title</title>
</head>
<body>
	<script>
		function add1(a, b) {
			if (!b) {
				b = 1;
			}
			return a + b;
		}
		console.log(add1(10));

		function add(a, b = 1) {
			return a + b;
		}
		console.log(add(10, 2));
		console.log(add(10));

		function fun(...values) {
			console.log(values);
		}
		fun(1, 2);
		fun(1, 2, 3, 4);
	</script>
</body>
</html>